In webwork.properties(as of Webwork 2.1.1), webwork.custom.i18n.resources=global-messages Serveral resource bundles can be specified by comma separating them. Java class (thanks Drew McAuliffe): public class WebworkGlobalMessagesListener implements ServletContextListener { private static Logger log = Logger.getLogger(WebworkGlobalMessagesListener.class); private static final String DEFAULT_RESOURCE = "global-messages"; /** * Uses the LocalizedTextUtil to load messages from the global message bundle. * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.Servle tContextEvent) */ public void contextInitialized(ServletContextEvent arg0) { log.info("Loading global messages from " + DEFAULT_RESOURCE); LocalizedTextUtil.addDefaultResourceBundle(DEFAULT_RESOURCE); log.info("Global messages loaded."); } /** * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) */ public void contextDestroyed(ServletContextEvent arg0) { // do nothing } } web.xml: <listener> <listener-class>mypackagename.WebworkGlobalMessagesListener</listener-class> </listener> |